package com.java.Work1;

public class Coder  {
    //自定义成员变量
    private String name;//姓名
    private int id;//工号
    private int salary;//工资
    //生成无参构造方法
    public Coder() {
    }
    //生成有参构造方法
    public Coder(String name, int id, int salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }
    //生成get set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }
    //自定义成员方法实现打印
    public void work() {

        System.out.println("工号为" + getId() + "基本工资为" + getSalary() + "的程序员方" + getName() + "正在努力的写着代码......");
    }
}

